package vip.idiy.anwei_android_iot.enums;

import java.util.ArrayList;
import java.util.List;

import vip.idiy.anwei_android_iot.R;
import vip.idiy.anwei_android_iot.dialog.IconInterface;
import vip.idiy.anwei_android_iot.domin.IconEntity;

/**
 * ClassName ImgEnum
 * describe: 图片枚举类,设备类型的图片
 * Created: 勇
 * Email:118085890@qq.com
 * Version: 1.0
 * Create in 17:11 2023/4/21
 */
public enum TypeImgEnum {
    switch_lighting("照明开关", R.mipmap.img_switch_lighting),
    switch_touch("触摸开关",R.mipmap.img_switch_touch)
    ;
    private String iconName;
    private int icon;

    TypeImgEnum(String iconName, int icon){
        this.iconName =iconName;
        this.icon = icon;
    }

    public String getIconName() {
        return iconName;
    }

    public void setIconName(String iconName) {
        this.iconName = iconName;
    }

    public int getIcon() {
        return icon;
    }

    public void setIcon(int icon) {
        this.icon = icon;
    }

    public static List<IconEntity> toList() {
        List<IconEntity> list = new ArrayList<>();
        for (TypeImgEnum typeImgEnum : TypeImgEnum.values()) {
            IconEntity iconEntity = new IconEntity(typeImgEnum.getIconName(), typeImgEnum.getIcon());
            list.add(iconEntity);
        }
        return list;
    }
}
